package com.itheima.mapper;

import com.itheima.bean.Student;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

public interface StudentMapper {
    @Select("select * from student")
    List<Student> findAll();
    /*添加学生*/
    @Insert("INSERT INTO student VALUES(#{number},#{name},#{birthday},#{address})")
    Integer add(Student student);

    /*修改学生信息*/
    @Update("UPDATE student SET NAME=#{name},birthday=#{birthday},address=#{address} WHERE number=#{number}")
    Integer update(Student student);



    /*删除学生信息*/
    @Delete("DELETE FROM student WHERE number=#{number}")
    Integer delete(String number);

}
